<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <style>
        #register-form {
    max-width: 300px;
    margin: 50px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#register-form p {
    margin-bottom: 10px;
}

#register-form input[type="text"],
#register-form input[type="password"],
#register-form input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

#register-form button {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
}

#register-form button:hover {
    background-color: #1e7e34;
}
    </style>
</head>
<body>
    <h2>注册</h2>
    <hr>
    <form action="{% url 'user:register' %}" method="post">  <!-- 更改 action 为注册视图的 URL -->
        {% csrf_token %}
        
        <p>用户名：<input type="text" name="uname" required></p>  <!-- 添加 required 属性 -->
        <p>密码：<input type="password" name="passwd" required></p>  <!-- 添加 required 属性 -->
        <p>年龄：<input type="number" name="age" required></p>  <!-- 更改类型为 number 并添加 required 属性 -->
        <p><button type="submit">注册</button></p>
    </form>
</body>
</html>